package com.hai.qtalk.base;

public class Counter {
	private static int clientConnectCount = 0;// 表示多少个客户端已建立连接
	private static int clientSendMessageCount = 0;// 表示多少个客户端已发送消息到服务器
	private static int clientReceiveMessageCount = 0;// 表示多少个客户端已接收到服务器返回的消息

	public static synchronized void AddClientReceiveMessageCount() {
		setClientReceiveMessageCount(getClientReceiveMessageCount() + 1);
	}

	public static int getClientReceiveMessageCount() {
		return clientReceiveMessageCount;
	}

	public static synchronized void AddClientSendMessageCount() {
		setClientSendMessageCount(getClientSendMessageCount() + 1);
	}

	public static void setClientReceiveMessageCount(
			int clientReceiveMessageCount) {
		Counter.clientReceiveMessageCount = clientReceiveMessageCount;
	}

	public static int getClientSendMessageCount() {
		return clientSendMessageCount;
	}

	public static void setClientSendMessageCount(int clientSendMessageCount) {
		Counter.clientSendMessageCount = clientSendMessageCount;
	}

	public static synchronized void AddClientConnectCount() {
		setClientConnectCount(getClientConnectCount() + 1);
	}

	public static int getClientConnectCount() {
		return clientConnectCount;
	}

	public static void setClientConnectCount(int clientConnectCount) {
		Counter.clientConnectCount = clientConnectCount;
	}
}
